﻿using System;

namespace YArchitech.HVAC.Nozzle
{
	public class NozzleCalcCheck
	{
		public int AirSeasonType
		{
			get
			{
				return this.airSeasonType;
			}
			set
			{
				this.airSeasonType = value;
			}
		}

		public double ParaL
		{
			get
			{
				return this.paraL;
			}
			set
			{
				this.paraL = value;
			}
		}

		public int Paran
		{
			get
			{
				return this.paran;
			}
			set
			{
				this.paran = value;
			}
		}

		public double Paray
		{
			get
			{
				return this.paray;
			}
			set
			{
				this.paray = value;
			}
		}

		public double Parax
		{
			get
			{
				return this.parax;
			}
			set
			{
				this.parax = value;
			}
		}

		public double Parad
		{
			get
			{
				return this.parad;
			}
			set
			{
				this.parad = value;
			}
		}

		public double ParaB
		{
			get
			{
				return this.paraB;
			}
			set
			{
				this.paraB = value;
			}
		}

		public double Paraa
		{
			get
			{
				return this.paraa;
			}
			set
			{
				this.paraa = value;
			}
		}

		public double Parag
		{
			get
			{
				return this.parag;
			}
			set
			{
				this.parag = value;
			}
		}

		public double Parats
		{
			get
			{
				return this.parats;
			}
			set
			{
				this.parats = value;
			}
		}

		public double Paratn
		{
			get
			{
				return this.paratn;
			}
			set
			{
				this.paratn = value;
			}
		}

		public double CalcAr
		{
			get
			{
				return this.calcAr;
			}
			set
			{
				this.calcAr = value;
			}
		}

		public double CalcVs
		{
			get
			{
				return this.calcVs;
			}
			set
			{
				this.calcVs = value;
			}
		}

		public double CalcVx
		{
			get
			{
				return this.calcVx;
			}
			set
			{
				this.calcVx = value;
			}
		}

		public double CalcVp
		{
			get
			{
				return this.calcVp;
			}
			set
			{
				this.calcVp = value;
			}
		}

		public double CalcLd
		{
			get
			{
				return this.calcLd;
			}
			set
			{
				this.calcLd = value;
			}
		}

		public double CalcN
		{
			get
			{
				return this.calcN;
			}
			set
			{
				this.calcN = value;
			}
		}

		public double ActualVs
		{
			get
			{
				return this.actualVs;
			}
			set
			{
				this.actualVs = value;
			}
		}

		public double ActualVx
		{
			get
			{
				return this.actualVx;
			}
			set
			{
				this.actualVx = value;
			}
		}

		public double ActualVp
		{
			get
			{
				return this.actualVp;
			}
			set
			{
				this.actualVp = value;
			}
		}

		public int ActualN
		{
			get
			{
				return this.actualN;
			}
			set
			{
				this.actualN = value;
			}
		}

		public void DoCalculate()
		{
			this.calcAr = Math.Round(this.GetAr(), 8);
			this.calcVs = Math.Round(this.GetCalcVs(), 4);
			this.calcVx = Math.Round(this.GetCalcVx(), 4);
			this.calcVp = Math.Round(this.GetCalcVp(), 4);
			this.calcLd = Math.Round(this.GetCalcLd(), 2);
			this.calcN = Math.Round(this.GetCalcN(), 2);
			this.actualVs = Math.Round(this.GetActualVs(), 4);
			this.actualVx = Math.Round(this.GetActualVx(), 4);
			this.actualVp = Math.Round(this.GetActualVp(), 4);
			this.actualN = this.GetActualN();
		}

		private double GetAr()
		{
			double num = this.paray / this.parad - this.parax / this.parad * Math.Tan(this.paraB);
			double num2 = Math.Pow(this.parax / this.parad / Math.Cos(this.ParaB), 2.0);
			double num3 = 0.51 * this.paraa * this.parax / this.parad / Math.Cos(this.paraB) + 0.35;
			return num / num2 / num3;
		}

		private double GetCalcVs()
		{
			double num = this.parag * this.parad * this.parats;
			double num2 = this.calcAr * (this.paratn + 273.0);
			return Math.Sqrt(num / num2);
		}

		private double GetCalcVx()
		{
			double num = this.paraa * this.parax / this.parad + 0.145;
			return this.calcVs * 0.48 / num;
		}

		private double GetCalcVp()
		{
			return 0.5 * this.calcVx;
		}

		private double GetCalcLd()
		{
			return 0.78539816339744828 * this.calcVs * 3600.0 * Math.Pow(this.parad, 2.0);
		}

		private double GetCalcN()
		{
			return this.paraL / this.calcLd;
		}

		private double GetActualVs()
		{
			return this.paraL / 0.78539816339744828 / Math.Pow(this.parad, 2.0) / (double)this.paran / 3600.0;
		}

		private double GetActualVx()
		{
			double num = this.paraa * this.parax / this.parad + 0.145;
			return this.actualVs * 0.48 / num;
		}

		private double GetActualVp()
		{
			return 0.5 * this.actualVx;
		}

		private int GetActualN()
		{
			return this.paran;
		}

		private int airSeasonType;

		private double paraL;

		private int paran;

		private double paray;

		private double parax;

		private double parad;

		private double paraB;

		private double paraa;

		private double parag;

		private double parats;

		private double paratn;

		private double calcAr;

		private double calcVs;

		private double calcVx;

		private double calcVp;

		private double calcLd;

		private double calcN;

		private double actualVs;

		private double actualVx;

		private double actualVp;

		private int actualN;
	}
}
